<?php 
    $valuteTotal = $this->Session->read("valutalist");
    $categorieTotal = $this->Session->read("categorylist");
?>
<div class="row">
    <h2 class="text-center" style="">Banner registrati:</h2>
        <div class="table-responsive">
        <table class="table-striped table-hover table-condensed text-center table-responsive" style="width: 95%;background: #fff;font-size: 12px;">
            <thead >
                <tr style="background-color:#414141;color:#fff;">
                    <th class="text-center">Logo</th>
                    <th class="text-center">Tipo</th>
                    <th class="text-center">Lingua</th>
                    <th class="text-center">Descrizione</th>
                    <th class="text-center">Posizione</th>
                    <th class="text-center">Target</th>
                    <th class="text-center">Link</th>
                    <th class="text-center">Visibile</th>
                    <?php if($this->Session->read("Auth.User.isAdministrator")) { ?>
                        <th class="text-center" colspan="2">Azioni</th>
                    <?php } ?>
                </tr>
            </thead>
            <?php if($this->Session->read("Auth.User.isAdministrator")) { ?>
                <tfoot>
                    <tr class="text-right">
                        <td colspan="13"><a href="<?php echo $this->webroot?>Banner/add"><i class="fa-plus"></i> Aggiungi un Banner</a></td>
                    </tr>
                </tfoot>
            <?php } ?>
            <tbody>
               <?php if(count($banners)==0){ ?>
                 <tr><td colspan="5">Non hai caricato nessun bookmaker.</td></tr>  
                   
               <?php }?>
               <?php foreach($banners as $key=>$banner){?>
                <tr>
                    <td>
                    	<div style="width: 200px;overflow: scroll;">
	                    	<?php if ($banner["Banner"]["use"]=="F") { ?>
		                    	<img src="<?php echo $this->webroot.$banner["Foto"]["webpath"];?>" style="width: 50px;" />
		                    <?php } else {
						        echo html_entity_decode($banner["Banner"]["html"] ,ENT_QUOTES);
		                    } ?>
                    	</div>
                    </td>
                    <td><?php echo $banner["Banner"]["use"]?></td>
                    <td><i class="<?php echo AppController::$flags[$banner["Banner"]["lang"]];?>"></i></td>
                    <td><?php echo $banner["Banner"]["descrizione"]?></td>
                    <td><?php echo Banner::$POSIZIONE[$banner["Banner"]["posizione"]]?></td>
                    <td><?php echo Banner::$TARGET[$banner["Banner"]["target"]]?></td>
                    <td><?php echo $banner["Banner"]["link"]?></td>
                    <td><?php echo $banner["Banner"]["visible"]?></td>
                    <?php if($this->Session->read("Auth.User.isAdministrator")) { ?>
                        <td><a data-confirm href="<?php echo $this->webroot?>Banner/delete/<?php echo $banner["Banner"]["id"]?>"><i class="fa-trash-o"></i> Elimina </a></td>
                        <td><a href="<?php echo $this->webroot?>Banner/edit/<?php echo $banner["Banner"]["id"]?>"><i class="fa-pencil"></i> Modifica</a></td>
                    <?php } ?>
                </tr>
               <?php }?>
            </tbody>
        </table>
    </div>
</div>
